package com.thssh.ui.lsn05.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.thssh.ui.R;

public class DemoActivity extends AppCompatActivity {

    public static final String EXTRA_VIEW = "extra_view";
    public static final int VIEW_ERASER = 0;
    public static final int VIEW_SCRATCH = 1;
    public static final int VIEW_X_FER_MODE = 2;
    public static final int VIEW_BITMAP_X_FER_MODE= 3;
    public static final int VIEW_X_FER_MODE_CIRCLE= 4;
    public static final int VIEW_LAYER= 5;

    private int mType;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        if(intent != null){
            mType = intent.getIntExtra(EXTRA_VIEW, VIEW_ERASER);
        }
        switch (mType){
            case VIEW_ERASER:
                getSupportActionBar().setTitle(R.string.title_xfermode_demo_2);
                setContentView(R.layout.activity_eraser);
                break;
            case VIEW_SCRATCH:
                getSupportActionBar().setTitle(R.string.title_xfermode_demo_3);
                setContentView(R.layout.activity_scratch);
                break;
            case VIEW_X_FER_MODE:
                getSupportActionBar().setTitle(R.string.title_xfermode_1);
                setContentView(R.layout.activity_xfer_mode);
                break;
            case VIEW_BITMAP_X_FER_MODE:
                getSupportActionBar().setTitle(R.string.title_xfermode_2);
                setContentView(R.layout.activity_bitmap_xfer_mode);
                break;
            case VIEW_X_FER_MODE_CIRCLE:
                getSupportActionBar().setTitle(R.string.title_xfermode_demo_1);
                setContentView(R.layout.activity_xfer_mode_circle);
                break;
            case VIEW_LAYER:
                getSupportActionBar().setTitle(R.string.title_xfermode_demo_4);
                setContentView(R.layout.activity_layer);
                break;
        }

    }
}
